#pragma once

#include <QtWidgets/QWidget>
#include "ui_Client.h"
#include <QSharedPointer>
#include <QJsonDocument>
#include <QJsonValue>
#include <QJsonObject>
#include <QTCPSocket>
#include <QTCPServer>

#include "http/qnetworkhttpclient.h"

QT_BEGIN_NAMESPACE
namespace Ui { class ClientClass; };
QT_END_NAMESPACE

class Client : public QWidget
{
    Q_OBJECT

public:
    Client(QWidget *parent = nullptr);
    ~Client();

    void initTCPClient();
    

public slots:
    void slot_sendMessage();
    void slot_sendMessagePost();
    void slot_newConnection();
    void slot_getDataFromServer();
    void slot_disconnected();
    void slot_sendData();

private:
    Ui::ClientClass *ui;
    QSharedPointer<QNetworkHttpClient> m_httpClient;

    QTcpSocket* m_clientSocket;
};
